package com.lykj.modules.shop.wrapper;

import com.lykj.core.mp.support.BaseEntityWrapper;
import com.lykj.core.tool.utils.BeanUtil;
import com.lykj.modules.shop.entity.UserOrder;
import com.lykj.modules.shop.vo.UserOrderVO;

import java.util.Objects;

/**
 * 现金订单表包装类,返回视图层所需的字段
 *
 * @author cxl
 * @since 2022-01-16
 */
public class UserOrderWrapper extends BaseEntityWrapper<UserOrder, UserOrderVO> {

	public static UserOrderWrapper build() {
		return new UserOrderWrapper();
	}

	@Override
	public UserOrderVO entityVO(UserOrder userOrder) {
		UserOrderVO userOrderVO = Objects.requireNonNull(BeanUtil.copy(userOrder, UserOrderVO.class));

		//User createUser = UserCache.getUser(userOrder.getCreateUser());
		//User updateUser = UserCache.getUser(userOrder.getUpdateUser());
		//userOrderVO.setCreateUserName(createUser.getName());
		//userOrderVO.setUpdateUserName(updateUser.getName());

		return userOrderVO;
	}

}
